package com.service.thirddatacenter.hpool.client;

import com.service.thirddatacenter.hpool.client.rep.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "hpoolAPI", url = "${hpool.url}/api/")
public interface HPoolClient {

    Integer success  = 200;

    /**
     * 矿机详情
     *
     * @param language
     * @param type
     * @param cookie
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "pool/detail")
    HPoolResponse<MinerDetail> minerDetail(@RequestParam("language") String language, @RequestParam("type") String type, @RequestHeader("cookie") String cookie);


    /**
     * 在线矿机
     *
     * @param language
     * @param type
     * @param count
     * @param page
     * @param cookie
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "pool/miner")
    HPoolResponse<HPoolPageResponse<List<Miner>>> pageMiner(@RequestParam("language") String language, @RequestParam("type") String type,
                                                            @RequestParam("count") Integer count, @RequestParam("page") Integer page, @RequestHeader("cookie") String cookie);

    /**
     * 贡献点
     *
     * @param language
     * @param type
     * @param count
     * @param page
     * @param day
     * @param cookie
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "pool/share")
    HPoolResponse<HPoolPageResponse<List<ShareRecord>>> pageShare(@RequestParam("language") String language, @RequestParam("type") String type,
                                                                  @RequestParam("count") Integer count, @RequestParam("page") Integer page, @RequestParam("day") Integer day, @RequestHeader("cookie") String cookie);

    /**
     * 每日结算
     *
     * @param language
     * @param type
     * @param count
     * @param page
     * @param cookie
     * @return
     */
    @RequestMapping(method = RequestMethod.GET, value = "pool/miningincomerecord")
    HPoolResponse<HPoolPageResponse<List<MiningIncomeRecord>>> pageMiningIncomeRecord(@RequestParam("language") String language, @RequestParam("type") String type,
                                                                                      @RequestParam("count") Integer count, @RequestParam("page") Integer page, @RequestHeader("cookie") String cookie);

}
